package com.ali.gts.servlet.controller;

import javax.servlet.*;
import java.io.IOException;

/**
 *
 *  第一个servlet 程序
 *
 */
public class HellServlet implements Servlet {

    public HellServlet() {
        System.out.println("1构造器方法");
    }

    @Override
    public void init(ServletConfig servletConfig) throws ServletException {
        System.out.println("2执行初始化的方法");

    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    /**
     *
     * 专门用来请求和响应的
     * @param servletRequest
     * @param servletResponse
     * @throws ServletException
     * @throws IOException
     */
    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {

        System.out.println("3、hello servlet");

    }

    @Override
    public String getServletInfo() {
        return null;
    }

    @Override
    public void destroy() {
        System.out.println("4执行servlet的销毁方法");
    }
}
